package com.gg.bananvideo.ui;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import com.bumptech.glide.Glide;
import com.gg.bananvideo.databinding.BVListItemBinding;

/**
 * Implementation of App Widget functionality.
 */
public class BVListItem extends LinearLayout {
    private BVListItemBinding binding;

    private String picUrl;

    private String vName;

    private String vDesc;


    public BVListItem(Context context, @Nullable @org.jetbrains.annotations.Nullable AttributeSet attrs) {
        super(context, attrs);
        LayoutInflater inflater = LayoutInflater.from(context);
        binding = BVListItemBinding.inflate(inflater, this, true);
    }

    public BVListItem(Context context) {
        super(context);
        LayoutInflater inflater = LayoutInflater.from(context);
        binding = BVListItemBinding.inflate(inflater, this, true);
    }

    public String getPicUrl() {
        return picUrl;
    }

    public void setPicUrl(String picUrl) {
        Glide.with(this)
                .load(picUrl)
                .into(binding.imgView);
        this.picUrl = picUrl;
    }

    public String getvName() {
        return vName;
    }

    public void setvName(String vName) {
        this.vName = vName;
        binding.vNameView.setText(vName);
    }

    public String getVDesc() {
        return vDesc;
    }

    public void setVDesc(String vDesc) {
        binding.vDescView.setText(vDesc);
        this.vDesc = vDesc;
    }
}
